.class Lcom/opongo/blogapp/activities/ShoutBoxActivity$downloadShoutboxAsyncTask;
.super Landroid/os/AsyncTask;
.source "ShoutBoxActivity.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/opongo/blogapp/activities/ShoutBoxActivity;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "downloadShoutboxAsyncTask"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/os/AsyncTask",
        "<",
        "Ljava/lang/String;",
        "Ljava/lang/Void;",
        "Ljava/lang/String;",
        ">;"
    }
.end annotation


# instance fields
.field final synthetic this$0:Lcom/opongo/blogapp/activities/ShoutBoxActivity;


# direct methods
.method private constructor <init>(Lcom/opongo/blogapp/activities/ShoutBoxActivity;)V
    .locals 0
    .parameter

    .prologue
    .line 163
    iput-object p1, p0, Lcom/opongo/blogapp/activities/ShoutBoxActivity$downloadShoutboxAsyncTask;->this$0:Lcom/opongo/blogapp/activities/ShoutBoxActivity;

    invoke-direct {p0}, Landroid/os/AsyncTask;-><init>()V

    return-void
.end method

.method synthetic constructor <init>(Lcom/opongo/blogapp/activities/ShoutBoxActivity;Lcom/opongo/blogapp/activities/ShoutBoxActivity$downloadShoutboxAsyncTask;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 163
    invoke-direct {p0, p1}, Lcom/opongo/blogapp/activities/ShoutBoxActivity$downloadShoutboxAsyncTask;-><init>(Lcom/opongo/blogapp/activities/ShoutBoxActivity;)V

    return-void
.end method


# virtual methods
.method protected bridge varargs synthetic doInBackground([Ljava/lang/Object;)Ljava/lang/Object;
    .locals 1
    .parameter

    .prologue
    .line 1
    check-cast p1, [Ljava/lang/String;

    invoke-virtual {p0, p1}, Lcom/opongo/blogapp/activities/ShoutBoxActivity$downloadShoutboxAsyncTask;->doInBackground([Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method protected varargs doInBackground([Ljava/lang/String;)Ljava/lang/String;
    .locals 15
    .parameter "params"

    .prologue
    .line 169
    const/4 v13, 0x0

    aget-object v12, p1, v13

    .line 171
    .local v12, urlString:Ljava/lang/String;
    new-instance v3, Lorg/apache/http/impl/client/DefaultHttpClient;

    invoke-direct {v3}, Lorg/apache/http/impl/client/DefaultHttpClient;-><init>()V

    .line 173
    .local v3, httpClient:Lorg/apache/http/client/HttpClient;
    const/4 v7, 0x0

    .line 174
    .local v7, response:Lorg/apache/http/HttpResponse;
    const/4 v10, 0x0

    .line 177
    .local v10, url:Ljava/net/URL;
    :try_start_0
    new-instance v11, Ljava/net/URL;

    invoke-direct {v11, v12}, Ljava/net/URL;-><init>(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/net/MalformedURLException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Lorg/apache/http/client/ClientProtocolException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_2

    .line 178
    .end local v10           #url:Ljava/net/URL;
    .local v11, url:Ljava/net/URL;
    :try_start_1
    new-instance v2, Lorg/apache/http/client/methods/HttpGet;

    invoke-virtual {v11}, Ljava/net/URL;->toString()Ljava/lang/String;

    move-result-object v13

    invoke-direct {v2, v13}, Lorg/apache/http/client/methods/HttpGet;-><init>(Ljava/lang/String;)V

    .line 181
    .local v2, getMethod:Lorg/apache/http/client/methods/HttpGet;
    const-string v13, "User-Agent"

    .line 182
    const-string v14, "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16"

    .line 180
    invoke-virtual {v2, v13, v14}, Lorg/apache/http/client/methods/HttpGet;->setHeader(Ljava/lang/String;Ljava/lang/String;)V

    .line 183
    invoke-interface {v3, v2}, Lorg/apache/http/client/HttpClient;->execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;
    :try_end_1
    .catch Ljava/net/MalformedURLException; {:try_start_1 .. :try_end_1} :catch_7
    .catch Lorg/apache/http/client/ClientProtocolException; {:try_start_1 .. :try_end_1} :catch_6
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_5

    move-result-object v7

    move-object v10, v11

    .line 197
    .end local v2           #getMethod:Lorg/apache/http/client/methods/HttpGet;
    .end local v11           #url:Ljava/net/URL;
    .restart local v10       #url:Ljava/net/URL;
    :goto_0
    if-nez v7, :cond_0

    .line 198
    const-string v8, "Error!"

    .line 233
    :goto_1
    return-object v8

    .line 184
    :catch_0
    move-exception v0

    .line 186
    .local v0, e:Ljava/net/MalformedURLException;
    :goto_2
    invoke-virtual {v0}, Ljava/net/MalformedURLException;->printStackTrace()V

    goto :goto_0

    .line 187
    .end local v0           #e:Ljava/net/MalformedURLException;
    :catch_1
    move-exception v0

    .line 189
    .local v0, e:Lorg/apache/http/client/ClientProtocolException;
    :goto_3
    invoke-virtual {v0}, Lorg/apache/http/client/ClientProtocolException;->printStackTrace()V

    goto :goto_0

    .line 190
    .end local v0           #e:Lorg/apache/http/client/ClientProtocolException;
    :catch_2
    move-exception v0

    .line 192
    .local v0, e:Ljava/io/IOException;
    :goto_4
    invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_0

    .line 200
    .end local v0           #e:Ljava/io/IOException;
    :cond_0
    sget-boolean v13, Lcom/opongo/blogapp/activities/ShoutBoxActivity;->DEBUG:Z

    if-eqz v13, :cond_1

    .line 201
    invoke-static {}, Lcom/opongo/blogapp/activities/ShoutBoxActivity;->access$0()Ljava/lang/String;

    move-result-object v13

    invoke-interface {v7}, Lorg/apache/http/HttpResponse;->getStatusLine()Lorg/apache/http/StatusLine;

    move-result-object v14

    invoke-virtual {v14}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v14

    invoke-static {v13, v14}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 203
    :cond_1
    invoke-interface {v7}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;

    move-result-object v1

    .line 205
    .local v1, entity:Lorg/apache/http/HttpEntity;
    if-eqz v1, :cond_3

    .line 207
    :try_start_2
    invoke-interface {v1}, Lorg/apache/http/HttpEntity;->getContent()Ljava/io/InputStream;

    move-result-object v4

    .line 209
    .local v4, instream:Ljava/io/InputStream;
    new-instance v6, Ljava/io/BufferedReader;

    .line 210
    new-instance v13, Ljava/io/InputStreamReader;

    invoke-direct {v13, v4}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;)V

    .line 209
    invoke-direct {v6, v13}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V

    .line 212
    .local v6, reader:Ljava/io/BufferedReader;
    new-instance v9, Ljava/lang/StringBuilder;

    invoke-direct {v9}, Ljava/lang/StringBuilder;-><init>()V

    .line 214
    .local v9, sb:Ljava/lang/StringBuilder;
    const/4 v5, 0x0

    .line 215
    .local v5, line:Ljava/lang/String;
    :goto_5
    invoke-virtual {v6}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;

    move-result-object v5

    if-nez v5, :cond_2

    .line 218
    invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    .line 220
    .local v8, result:Ljava/lang/String;
    goto :goto_1

    .line 216
    .end local v8           #result:Ljava/lang/String;
    :cond_2
    new-instance v13, Ljava/lang/StringBuilder;

    invoke-static {v5}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v14

    invoke-direct {v13, v14}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v14, "\n"

    invoke-virtual {v13, v14}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v13

    invoke-virtual {v13}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v13

    invoke-virtual {v9, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    :try_end_2
    .catch Ljava/lang/IllegalStateException; {:try_start_2 .. :try_end_2} :catch_3
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_4

    goto :goto_5

    .line 225
    .end local v4           #instream:Ljava/io/InputStream;
    .end local v5           #line:Ljava/lang/String;
    .end local v6           #reader:Ljava/io/BufferedReader;
    .end local v9           #sb:Ljava/lang/StringBuilder;
    :catch_3
    move-exception v0

    .line 227
    .local v0, e:Ljava/lang/IllegalStateException;
    invoke-virtual {v0}, Ljava/lang/IllegalStateException;->printStackTrace()V

    .line 233
    .end local v0           #e:Ljava/lang/IllegalStateException;
    :cond_3
    :goto_6
    const-string v8, "Error!"

    goto :goto_1

    .line 228
    :catch_4
    move-exception v0

    .line 230
    .local v0, e:Ljava/io/IOException;
    invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_6

    .line 190
    .end local v0           #e:Ljava/io/IOException;
    .end local v1           #entity:Lorg/apache/http/HttpEntity;
    .end local v10           #url:Ljava/net/URL;
    .restart local v11       #url:Ljava/net/URL;
    :catch_5
    move-exception v0

    move-object v10, v11

    .end local v11           #url:Ljava/net/URL;
    .restart local v10       #url:Ljava/net/URL;
    goto :goto_4

    .line 187
    .end local v10           #url:Ljava/net/URL;
    .restart local v11       #url:Ljava/net/URL;
    :catch_6
    move-exception v0

    move-object v10, v11

    .end local v11           #url:Ljava/net/URL;
    .restart local v10       #url:Ljava/net/URL;
    goto :goto_3

    .line 184
    .end local v10           #url:Ljava/net/URL;
    .restart local v11       #url:Ljava/net/URL;
    :catch_7
    move-exception v0

    move-object v10, v11

    .end local v11           #url:Ljava/net/URL;
    .restart local v10       #url:Ljava/net/URL;
    goto :goto_2
.end method

.method protected bridge synthetic onPostExecute(Ljava/lang/Object;)V
    .locals 0
    .parameter

    .prologue
    .line 1
    check-cast p1, Ljava/lang/String;

    invoke-virtual {p0, p1}, Lcom/opongo/blogapp/activities/ShoutBoxActivity$downloadShoutboxAsyncTask;->onPostExecute(Ljava/lang/String;)V

    return-void
.end method

.method protected onPostExecute(Ljava/lang/String;)V
    .locals 7
    .parameter "htmlString"

    .prologue
    .line 238
    new-instance v6, Landroid/content/Intent;

    const-string v0, "com.opongo.progressDialog_hide"

    invoke-direct {v6, v0}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 239
    .local v6, i:Landroid/content/Intent;
    const-string v0, "MESSAGE"

    iget-object v1, p0, Lcom/opongo/blogapp/activities/ShoutBoxActivity$downloadShoutboxAsyncTask;->this$0:Lcom/opongo/blogapp/activities/ShoutBoxActivity;

    const v2, 0x7f070017

    invoke-virtual {v1, v2}, Lcom/opongo/blogapp/activities/ShoutBoxActivity;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v6, v0, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 240
    iget-object v0, p0, Lcom/opongo/blogapp/activities/ShoutBoxActivity$downloadShoutboxAsyncTask;->this$0:Lcom/opongo/blogapp/activities/ShoutBoxActivity;

    #getter for: Lcom/opongo/blogapp/activities/ShoutBoxActivity;->context:Landroid/content/Context;
    invoke-static {v0}, Lcom/opongo/blogapp/activities/ShoutBoxActivity;->access$1(Lcom/opongo/blogapp/activities/ShoutBoxActivity;)Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0, v6}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V

    .line 242
    sget-boolean v0, Lcom/opongo/blogapp/activities/ShoutBoxActivity;->DEBUG:Z

    if-eqz v0, :cond_0

    .line 243
    sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;

    invoke-virtual {v0, p1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

    .line 244
    invoke-static {}, Lcom/opongo/blogapp/activities/ShoutBoxActivity;->access$0()Ljava/lang/String;

    move-result-object v0

    iget-object v1, p0, Lcom/opongo/blogapp/activities/ShoutBoxActivity$downloadShoutboxAsyncTask;->this$0:Lcom/opongo/blogapp/activities/ShoutBoxActivity;

    #getter for: Lcom/opongo/blogapp/activities/ShoutBoxActivity;->currentURL:Ljava/lang/String;
    invoke-static {v1}, Lcom/opongo/blogapp/activities/ShoutBoxActivity;->access$2(Lcom/opongo/blogapp/activities/ShoutBoxActivity;)Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 247
    :cond_0
    iget-object v0, p0, Lcom/opongo/blogapp/activities/ShoutBoxActivity$downloadShoutboxAsyncTask;->this$0:Lcom/opongo/blogapp/activities/ShoutBoxActivity;

    #getter for: Lcom/opongo/blogapp/activities/ShoutBoxActivity;->postContentView:Landroid/webkit/WebView;
    invoke-static {v0}, Lcom/opongo/blogapp/activities/ShoutBoxActivity;->access$3(Lcom/opongo/blogapp/activities/ShoutBoxActivity;)Landroid/webkit/WebView;

    move-result-object v0

    const-string v1, "http://www.mein-deal.com"

    const-string v3, "text/html"

    const-string v4, "UTF-8"

    const/4 v5, 0x0

    move-object v2, p1

    invoke-virtual/range {v0 .. v5}, Landroid/webkit/WebView;->loadDataWithBaseURL(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 248
    return-void
.end method
